From: kaf24@firebug.cl.cam.ac.uk Date: Mon, 19 Mar 2007 09:34:42 +0000 (+0000) Subject: minios: Various small fixes. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15282^2~28 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f55d16fa21b0e87079c4075597c355251131ad16;p=xen.git minios: Various small fixes. - Fixed type of variables in hypervisor.c. - Fixed not removing a waiter from watch_queue. - Make wait_for_watch() global accessible. Signed-off-by: Dietmar Hahn --- diff --git a/extras/mini-os/hypervisor.c b/extras/mini-os/hypervisor.c index 2c2efa7e46..ed87845195 100644 --- a/extras/mini-os/hypervisor.c +++ b/extras/mini-os/hypervisor.c @@ -35,8 +35,8 @@ void do_hypervisor_callback(struct pt_regs *regs) { - u32 l1, l2; - unsigned int l1i, l2i, port; + unsigned long l1, l2, l1i, l2i; + unsigned int port; int cpu = 0; shared_info_t *s = HYPERVISOR_shared_info; vcpu_info_t *vcpu_info = &s->vcpu_info[cpu]; diff --git a/extras/mini-os/include/wait.h b/extras/mini-os/include/wait.h index f581db9109..d8338fbd8e 100644 --- a/extras/mini-os/include/wait.h +++ b/extras/mini-os/include/wait.h @@ -74,6 +74,13 @@ static inline void wake_up(struct wait_queue_head *head) local_irq_restore(flags); \ } while (0) +#define remove_waiter(w) do { \ + unsigned long flags; \ + local_irq_save(flags); \ + remove_wait_queue(&w); \ + local_irq_restore(flags); \ +} while (0) + #define wait_event(wq, condition) do{ \ unsigned long flags; \ if(condition) \ diff --git a/extras/mini-os/include/xenbus.h b/extras/mini-os/include/xenbus.h index 3866a8bbce..cd4e85d122 100644 --- a/extras/mini-os/include/xenbus.h +++ b/extras/mini-os/include/xenbus.h @@ -13,6 +13,7 @@ void init_xenbus(void); char *xenbus_read(xenbus_transaction_t xbt, const char *path, char **value); char *xenbus_watch_path(xenbus_transaction_t xbt, const char *path); +void wait_for_watch(void); char* xenbus_wait_for_value(const char*,const char*); /* Associates a value with a path. Returns a malloc'd error string on diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c index f483211947..9433b22b02 100644 --- a/extras/mini-os/xenbus/xenbus.c +++ b/extras/mini-os/xenbus/xenbus.c @@ -72,11 +72,12 @@ static void memcpy_from_ring(const void *Ring, memcpy(dest + c1, ring, c2); } -static inline void wait_for_watch(void) +void wait_for_watch(void) { DEFINE_WAIT(w); add_waiter(w,watch_queue); schedule(); + remove_waiter(w); wake(current); }